package campshop.models;

import java.io.Serializable;

import org.apache.commons.lang.builder.HashCodeBuilder;
import org.apache.commons.lang.builder.ReflectionToStringBuilder;


public class ModelBase implements Serializable {

	private static final long serialVersionUID = -7645811462528595194L;
	private long id;
	
	public boolean equals(Object obj){
		if(this==obj) return true;
		if(!(obj instanceof ModelBase))return false;
		ModelBase target = (ModelBase)obj;
		if(this.getId() != 0)return this.getId()==target.getId();
		return false;
	}
	public int hashCode(){
		return HashCodeBuilder.reflectionHashCode(this);
	}
	public String toString(){
		return ReflectionToStringBuilder.toString(this);
	}
	
	public void destroy()
	{
		
	}
	
	//setters & getters
	public void setId(long id){
		this.id = id;
	}
	public long getId(){
		return id;
	}
	
}
